﻿using NUnit.Framework;
using Sasa.QualityTools.CodeAnalysis.SearchEngine.Processing.Tokens;
using System;

namespace Sasa.QualityTools.CodeAnalysis.SearchEngine.Tests.Unit.Processing.Tokens
{
    [TestFixture]
    public class OrTokenTest
    {
        private Or testee;


        public TestContext TestContext { get; set; }


        [SetUp]
        public void SetUp()
        {
            this.testee = new Or { Value = "OR" };
        }

        [Test]
        public void TestEqualsWithNull()
        {
            Assert.IsFalse(this.testee.Equals(null));
        }

        [Test]
        public void TestEqualsWithDiffType()
        {
            Assert.IsFalse(this.testee.Equals(""));
        }

        [Test]
        public void TestEqualsWithSame()
        {
            Assert.IsTrue(this.testee.Equals(this.testee));
        }

        [Test]
        public void TestEquals()
        {
            Assert.IsTrue(this.testee.Equals(new Or { Value = "OR" }));
        }

        [Test]
        public void TestEqualsWithObjDiffValue()
        {
            Assert.IsFalse(this.testee.Equals(new Or { Value = "AND" }));
        }
    }
}
